<!doctype html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>中海创科技 - 海创EAP低代码工业互联网平台-登录</title>
    <link rel="stylesheet" type="text/css" href="/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/icon/iconfont.css">
    <link rel="stylesheet" type="text/css" href="/css/common.css">
    <link rel="stylesheet" type="text/css" href="/css/login.css">
    <script type="text/javascript" src="/plugins/jquery.min.js"></script>
    <script type="text/javascript" src="/plugins/bootstrap/js/bootstrap.min.js"></script>
</head>
<style>
    .hc_login_l {
        background: url(/images/login/login-bg.png) no-repeat center/cover;
    }
</style>

<body>
    <div class="hc_login_logo">
        <a href="/page/index.html">
            <img width=""
                src="https://www.hieap.cn/file/static/preview?relativePath=0000221/eapdev/2022-08-02/e001a535-6fa2-46db-8fb7-e96311862f14.png"
                alt="">
        </a>
    </div>
    <div class="hc_login">
        <div class="hc_login_l">
        </div>
        <div class="hc_login_r">
            <div class="hc_login_r_ctn">
                <h2>海创EAP低代码开发平台</h2>
                <div class="tab-content">
                    <div class="tab-pane fade in active" id="signTab">
                        <ul class="hc_login_r_tab">
                            <li class="active">
                                <a href="#pwLogin" data-toggle="tab">密码登录</a>
                            </li>
                            <li>
                                <a href="#msgLogin" data-toggle="tab">短信登录</a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane fade in active" id="pwLogin">
                                <form>
                                    <div class="hc_login_field hc_user">
                                        <input type="text" placeholder="账号">
                                        <img src="/images/login/user.png" alt="">
                                        <p class="hc_error_info">
                                            账号不能为空
                                        </p>
                                    </div>
                                    <div class="hc_login_field hc_pass">
                                        <input type="password" placeholder="密码" autoComplete="true">
                                        <img src="/images/login/pass.png" alt="">
                                        <p class="hc_error_info">
                                            密码不能为空
                                        </p>
                                    </div>
                                    <button type="button" class="hc_login_btn" id="passLogin">
                                        <i class="iconfont icon-jiazaizhong hc-loading"></i>
                                        <span>登录</span>
                                    </button>
                                </form>
                            </div>
                            <div class="tab-pane fade" id="msgLogin">
                                <form>
                                    <div class="hc_login_field">
                                        <input type="text" placeholder="手机号">
                                        <i class="iconfont icon-shouji"></i>
                                    </div>
                                    <div class="hc_login_field">
                                        <input type="text" placeholder="验证码">
                                        <i class="iconfont icon-yanzhengma"></i>
                                        <button type="button" class="hc_login_sendbtn">发送验证码</button>
                                    </div>
                                    <button type="button" class="hc_login_btn">
                                        <i class="iconfont icon-jiazaizhong hc-loading"></i>
                                        <span>登录</span>
                                    </button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="hc_login_tab">
                    <a class="hc_register" href="/page/register.html">立即注册</a>
                    <span>|</span>
                    <a class="forgotpass" href="javascript:;">忘记密码</a>
                </div>
                <div class="hc_login_r_other">
                    <h3><span>使用其他账号登录</span></h3>
                    <ul>
                        <li><img src="/images/login/wechat.png" alt=""></li>
                        <li><img src="/images/login/qq.png" alt=""></li>
                        <li><img src="/images/login/zfb.png" alt=""></li>
                        <li><img src="/images/login/weibo.png" alt=""></li>
                    </ul>
                    <!-- <h4>登录视为您已同意第三方账号绑定协议、服务条款、隐私政策</h4> -->
                </div>
            </div>
        </div>
    </div>

    <div class="forgotPassdDialog  hc_register">
        <div class="hc_forgot_box">
            <div class="hc_forgot_top">
                <h2 class="hc_forgot_title">忘记密码</h2>
                <i id="closeFrogotbox" class="iconfont icon-jiahao"></i>
            </div>
            <div class="frogotPsssFrom" id="frogotPsssFrom">
                <form>
                    <div class="hc_login_field forgot_phone">
                        <input type="text" id="phone" placeholder="手机号">
                        <i class="iconfont icon-shouji"></i>
                        <p class="hc_error_info">
                            请输入手机号
                        </p>
                    </div>
                    <div class="hc_login_field forgot_pass">
                        <input type="password" placeholder="密码" autoComplete="true">
                        <img src="/images/login/pass.png" alt="">
                        <p class="hc_error_info">
                            请输入密码
                        </p>
                    </div>
                    <div class="hc_login_field forgot_ycode">
                        <input type="text" placeholder="验证码">
                        <i class="iconfont icon-yanzhengma"></i>
                        <p class="hc_error_info">
                            请输入验证码
                        </p>
                        <button type="button" class="hc_login_sendbtn">获取验证码</button>
                    </div>
                    <button type="button" class="hc_login_btn" id="resetpass">重置密码</button>
                </form>
            </div>
        </div>
    </div>

    <script>
        $(function () {
            resizeBase();
            $(window).on("resize", function () {
                resizeBase();
            });
            $("#passLogin").on("click", function () {
                passLogin()
            })
            $("#pwLogin").on("keydown", function (e) {
                var e = e || window.event;
                if (e.keyCode == 13) {
                    passLogin()
                }
            })
            $(".hc_user input").on("input", function () {
                let userName = $(".hc_user input").val()
                if (userName) {
                    $(".hc_user .hc_error_info").css("opacity", "0")
                }
            })
            $(".hc_pass input").on("input", function () {
                let passWord = $(".hc_pass input").val()
                if (passWord) {
                    $(".hc_pass .hc_error_info").css("opacity", "0")
                }
            })

            // 点击忘记密码
            $(".forgotpass").on("click", function () {
                $(".forgotPassdDialog").css("display", "flex")
            })

            // 关闭忘记密码弹出框
            $("#closeFrogotbox").on("click", function () {
                $(".forgotPassdDialog").css("display", "none")
            })

            // 点击重置密码
            $("#resetpass").on("click", function () {
                resetPass()
            })

        });
        function resizeBase() {
            var baseW = $(window).width() > 768 ? 1920 : 750;
            $("html").css({
                "font-size": $(window).width() / baseW * 100 + "px"
            });
        }

        function passLogin() {
            let userName = $(".hc_user input").val()
            let passWord = $(".hc_pass input").val()
            if (!userName) {
                $(".hc_user .hc_error_info").css("opacity", "1")
            }
            if (!passWord) {
                $(".hc_pass .hc_error_info").css("opacity", "1")
            }
            if (userName && passWord) {
                if (userName == "admin" && passWord == "9999") {
                    // window.location.href = "/page/index.html"
                    $("#passLogin").addClass("disable")
                    $("#passLogin").attr("disabled", "true")
                    setTimeout(function () {
                        hcMessage("登录成功", "success")
                        setTimeout(function () {
                            window.location.href = "/page/index.html"
                        }, 1000)
                    }, 1000)
                } else {
                    hcMessage("账号或密码错误")
                }

            }
        }

        // 重置密码
        function resetPass() {
            let phone = $(".forgot_phone input").val()
            let passWord = $(".forgot_pass input").val()
            let ycode = $(".forgot_ycode input").val()
            if (!phone) {
                $(".forgot_phone .hc_error_info").css("opacity", "1")
            }
            if (!passWord) {
                $(".forgot_pass .hc_error_info").css("opacity", "1")
            }
            if (!ycode) {
                $(".forgot_ycode .hc_error_info").css("opacity", "1")
            }
        }

        // 消息提示
        function hcMessage(content, type) {
            let cls = type || ""
            var body = document.body;
            var div = document.createElement("div");
            var i = document.createElement("i");
            i.classList.add("iconfont");
            if (cls) {
                i.classList.add("icon-qiyong");
            } else {
                i.classList.add("icon-chucuo");
            }
            div.setAttribute("class", "hc_message " + cls);
            div.appendChild(i);
            div.style.top = "-100px"
            var text = document.createTextNode(content);
            div.appendChild(text);
            body.appendChild(div);
            setTimeout(() => {
                div.style.top = "25px"
            }, 100)
            setTimeout(() => {
                body.removeChild(div);
            }, 3000);
        }
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var url = 'returnUrl=http://studio2.hieap.cn/#/?projectName=eapdev%2F0000221&path=eapdev.pro%2FMenHu.dir%2Fpage.moduledir%2Fview.viewdir%2Findex.vm'
            // var r = window.location.search.substr(1).match(reg);
            var r = url.match(reg)
            if (r != null) return decodeURI(r[2]);
            return null;
        }




    </script>
</body>

</html>